package com.kuang.demo.controller;

import com.kuang.demo.bean.BaseRespVo;
import com.kuang.demo.bean.TemporaryLoginInfo;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.ArrayList;
import java.util.List;

@RestController
@RequestMapping("admin/auth")
public class TemporaryLoginController {
    TemporaryLoginInfo temporaryLoginInfo=new TemporaryLoginInfo();
    List<String> roles=new ArrayList<>();
    List<String> perms=new ArrayList<>();
    @RequestMapping("login")
    public BaseRespVo authLogin(){
        return BaseRespVo.ok("60acf512-99ec-4570-ab8d-9ba0f7f74d56");
    }
    @GetMapping("info")
    public BaseRespVo authInfo(){
        roles.add("超级管理员");
        perms.add("*");
        temporaryLoginInfo.setAvatar("https://wpimg.wallstcn.com/f778738c-e4f8-4870-b634-56703b4acafe.gif");
        temporaryLoginInfo.setName("admin123");
        temporaryLoginInfo.setRoles(roles);
        temporaryLoginInfo.setPerms(perms);
        return BaseRespVo.ok(temporaryLoginInfo);
    }
}
